package com.example.petshop.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.petshop.entity.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Optional;

@Mapper
public interface UserMapper extends BaseMapper<User> {

    User getUserProfile();
    List<User> getAllUsers();
    User login(@Param("username")String username, @Param("password") String password);


    User findByUsername(String username);
    String getNickname(String username);

    int updateUserTypeById(@Param("userType") String userType, @Param("userId") Long userId);
    int insert(User user);

    void deleteById(long userId);

    void updateUser(User user);

    User findByNickname(String nickname);
}
